var url;
var body = document.body;
var rightDiv = document.getElementById("right");

module.exports = {
	onshow: function () {
		var _this = this;
		var a = body.$$("#menu a");

		for (var i=0; i<a.length; i++) {
			a[i].removeClass("current");
		}

		switch (JFram.queryParam.do) {
			case "start" : url = "./html/start.html"; body.$("#a_start").addClass("current"); break;
			case "use" : url = "./html/use.html"; body.$("#a_use").addClass("current");  break;
			case "download" : url = "./html/download.html"; body.$("#a_download").addClass("current");  break;
		}

		if (!JFram.assets[url]) {
			JFram.ajax({
				url: url,
				dataType: "text",
				success: function(data) {
					JFram.assets[url] = data;
					_this.render(data);
				}
			});
		} else {
			this.render(JFram.assets[url])
		}
	},
	render: function(html) {
		rightDiv.scrollTop = 0;
		rightDiv.innerHTML = html;
	}
}